<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>
    $(function () {
        var upper = $("#dutyNurseId").val();
        var dire = $("#qualityNurseId").val();
        selectedWard($("#wardCode").val(), upper,dire);
    });
    function selectedWard(ward,duty,quality){
        loadDoctorByDept(ward, duty,'dutyNurse','${ctx}/sys/orgGroupVsDept/findUserByDeptId');
        loadDoctorByDept(ward, quality,'qualityNurse','${ctx}/sys/orgGroupVsDept/findUserByDeptId');
    }
</script>
<form:form id="inputForm" data-parsley-validate=""  modelAttribute="turnInVo" onsubmit="return formTurnOutLoad('turnOutForm','inputForm','${ctx}/nurse/wardCirculation/saveTurnOutPatient','${ctx}/doctor/patVisit/index','${turnInVo.patientId}','${turnInVo.visitId}');" method="post" class="form-horizontal">
        <form:hidden path="id"/>
        <form:hidden path="patientId"/>
        <form:hidden path="patVisitId"/>
        <form:hidden path="bedRecId"/>
        <div class="form-group">
            <label class="col-sm-4 control-label">姓名：</label>
            <div class="col-sm-8">
                <form:input path="name" htmlEscape="false" class="form-control"  maxlength="32" readonly="true"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">性别：</label>
            <div class="col-sm-8">
                <form:select path="sex" id="sex" class="form-control" data-parsley-required="true"  disabled="true">
                    <form:options items="${fns:getDictList('SEX_DICT')}" itemLabel="label" itemValue="value"  htmlEscape="false"/>
                </form:select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">转出病区：</label>
            <div class="col-sm-8">
                <input readonly class="form-control"   value="${fns:getDeptName(turnInVo.wardCode,'' )}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">转向病区：</label>
            <div class="col-sm-8">
            <sys:treeselect selectedParent="true" method="selectedWard" id="wardCode" name="wardCode" value=""  update="false" labelName="" labelValue=""
                                title="科室" url="/sys/orgDept/treeData?clinicAttrs=2"  cssClass="form-control"  isnull="true"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">转出时间：</label>
            <div class="col-sm-8">
                <input class="form-control"  maxlength="20" readonly value="<fmt:formatDate value="${turnInVo.transferDate}" pattern="yyyy-MM-dd hh:mm:ss"></fmt:formatDate>"/>
            </div>
        </div>
    <div class="form-group">
        <label class="col-sm-4 control-label">责任护士：</label>
        <div class="col-sm-8">
            <input type="hidden" value="${turnInVo.dutyNurse}" id="dutyNurseId">
            <form:select path="dutyNurse" id="dutyNurse" class="form-control" data-parsley-required="true">
                <form:option value="" label="请选择"></form:option>
            </form:select>
           <%-- <select name="dutyNurse" class="form-control">
                <c:forEach items="${users}" var="u">
                    <option value="${u.id}" <c:if test="${turnInVo.dutyNurse eq u.id}" >selected</c:if>>${u.name}</option>
                </c:forEach>
            </select>--%>
        </div>
    </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">质控护士：</label>
            <div class="col-sm-8">
                <input type="hidden" value="${turnInVo.qualityNurse}" id="qualityNurseId">
                <form:select path="qualityNurse" id="qualityNurse" class="form-control" data-parsley-required="true">
                    <form:option value="" label="请选择"></form:option>
                </form:select>
                <%--<select name="qualityNurse" class="form-control">
                    <c:forEach items="${users}" var="u">
                        <option value="${u.id}" <c:if test="${turnInVo.qualityNurse eq u.id}" >selected</c:if>>${u.name}</option>
                    </c:forEach>
                </select>--%>
            </div>
        </div>

    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <input id="btnSubmit" class="btn btn-primary" type="submit" value="确 定">&nbsp;
          <%--  <input id="btnCancel" class="btn" type="button" value="关 闭" onclick="closeTurnOutForm()"></div>--%>
    </div>
</form:form>
